import request from '@/utils/request'
// import type { LoginForm, LoginResponseData, UserResponseData } from './type'

// enum API {
//   LOGIN_URL = '/user/login',
//   USERINFO_URL = '/user/info',
// }

// //  暴露请求函数
// // 登录接口方法
// export const reqLogin = (data: LoginForm) =>
//   request.post<any, LoginResponseData>(API.LOGIN_URL, data)
// // 获取用户接口
// export const reqUserInfo = () =>
//   request.get<any, UserResponseData>(API.USERINFO_URL)

import type {
  LoginFormData,
  LoginResponseData,
  UserInfoResponseData,
} from './type'

enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}
//登陆接口
export const reqLogin = (data: LoginFormData) =>
  request.post<any, LoginResponseData>(API.LOGIN_URL, data)

//获取用户信息
export const reqUserInfo = () =>
  request.get<any, UserInfoResponseData>(API.USERINFO_URL)

// 退出登陆
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
